home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr11
/
powerb5.zip
/
P5DOS014.TIP
< prev
next >
Wrap
Text File
|
1993-06-01
|
2KB
|
53 lines
I recently needed about a dozen randomized name lists in
order to assign students to groups. It occurred to me that
the DOS SORT routine had the ability to sort lists in
seemingly random fashion. Ordinarily, you would use the
command SORT < NAMES.DAT to sort the lines in the file
NAMES.DAT in the usual fashion, by first character. However,
if one uses the /+n extension, sorting will begin with
column n of each line. Thus, the (more or less) random
characters in the names determine the ordering, giving a
scrambled list.
For example, if the file NAMES.DAT contains the five lines:
Arthur
Gilbert
Rachel
Robert
Susanne
the command SORT/+3 < NAMES.DAT displays:
Robert
Rachel
Gilbert
Susanne
Arthur
The file containing the names (or any other words or lines
to be scrambled) can be any ASCII file. First names, last
names, and other information can also be included. Spaces
and punctuation present no problem, because they have ASCII
codes that DOS will use in sorting. The number of possible
scrambled lists one can get depends only on the length of
the lines one uses.
Lawrence Corrado
Manitowoc, Wisconsin
Editor's Note: This is the first time I've ever heard of a
sort utility being used to unsort names, but the idea is a
good one. This technique can be used in almost any situation
where groups of names must be chosen at random -- such as in
simple games or while deciding on promotions within your
organization.
Title: Using SORT to Unsort
Category: DOS
Issue Date: December, 1992
Editor: Brett Glass
Supplementary Files: None
Filename: P5DOS014.TIP